﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ACM_FINANCE_Receive.aspx.cs" Inherits="KPIS.GERP.GAMS.APP.App_UI.Forms.ACM_FINANCE_RECEIVE" %>

<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="head">
    <title>รับเงินต่าง ๆเข้ามาในระบบ</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Body" runat="server" contentplaceholderid="ContentPlaceHolder1" >
    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        
            function openWin()
            {
                var oWnd = radopen("ACM_POPUP.aspx", "RadWindow1");
            }
            function OnClientClose(oWnd,args)
            {
                var arg = args.get_argument();
                if(arg)
                { 
                    var account_seq = arg.account_seq;
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(account_seq);
                }
            }
            function OnTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
        </script>
    </telerik:RadCodeBlock>

    
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
        <script type="text/javascript">
        
            function openWin()
            {
                var oWnd = radopen("ACM_POPUP.aspx", "RadWindow1");
            }
            function OnClientClose(oWnd,args)
            {
                //get the transferred arguments
                var arg = args.get_argument();
                if(arg)
                { 
                    var account_seq = arg.account_seq;
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(account_seq);
                }
            }
            
        </script>
    </telerik:RadCodeBlock>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
        OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Pane2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
       
  <div class="moduleContent1000">
       <div class="moduleDivBottom1000">
            <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                  <div class = "RHeader" align = "center">
                         <%--<fieldset style= "width:350px;height:25px;">
                              กรณีรับเงินต่างๆ (ต่อจากทางการเงิน)
                         </fieldset><br />--%>
                     <%--    <script type="text/javascript">
                            function Hilite(me, focus)
                            { 
                                me.style.backgroundColor = false != focus ? "#ffffcc" : "white"; 
                            }
                         </script>--%>
                     </div> 
                     
                     <table cellpadding="0" cellspacing="0" align = "right" >
                               <tr>
                                        <td>
                                            <asp:Label ID="lblStatus" runat="server" Text="สถานะของข้อมูล" ForeColor="Orange" Font-Size="Large" Font-Bold="true"></asp:Label>
                                            <asp:Label ID="hStatus" runat="server" visiblie ="false"></asp:Label>
                                        </td>
                                        <td>&nbsp;</td><td>&nbsp;</td>
                                        <td width="100px" class="controls">
                                            <asp:LinkButton ID="btnSave" runat="server" CssClass="LinkButton" onclick="btnSave_Click" CausesValidation="true">
                                                <img alt="" id="imgSave" runat="server" src="~/App_UI/Images/Buttons/saveDisk.gif" title="บันทึกข้อมูล" width="17"/> บันทึกข้อมูล
                                            </asp:LinkButton>                                            
                                        </td>
                                        <td width="100px" class="controls">
                                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="LinkButton" onclick="btnCancel_Click" CausesValidation="False">
                                                <img alt="" id="imgCancel" runat="server" src="~/App_UI/Images/Buttons/Cancel.gif" title="ยกเลิกการแก้ไข" width="17"/> ยกเลิกการแก้ไข
                                            </asp:LinkButton>
                                        </td>
                               </tr>
                     </table>
                     <br />
             </asp:Panel>         
        </div>
   </div>          
        
   <div class="moduleContent1000">
    <div class ="moduleDivBottom1000">
           <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="530px" ScrollBars="Auto" align ="center" >
                  <table>       
                     <tr>
                              <td> 
                                             <telerik:RadGrid ID="RadGridFinance" runat="server" AutoGenerateColumns="false"
                                                        AllowMultiRowEdit="false" AllowMultiRowSelection="true" 
                                                        Width="900px" Height="393px" AllowPaging="true" AllowFilteringByColumn="true"
                                                        GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                        GroupingSettings-GroupContinuedFormatString=""
                                                        GroupingSettings-GroupContinuesFormatString=""
                                                        GroupingSettings-GroupSplitFormat=""
                                                        OnNeedDataSource="grdACMReceiveFinance_NeedDataSource" 
                                                        OnItemCommand="grdACMReceiveFinance_ItemCommand" align ="left" >
                                                        <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                            DataKeyNames="receive_type_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                            <RowIndicatorColumn>
                                                                <HeaderStyle Width="20px" />
                                                            </RowIndicatorColumn>
                                                            <ExpandCollapseColumn>
                                                                <HeaderStyle Width="20px" />
                                                            </ExpandCollapseColumn>
                                                            <Columns>   
                                                                <telerik:GridTemplateColumn HeaderText="แก้ไข" AllowFiltering="false" HeaderStyle-Width="43" HeaderStyle-Font-Bold="true" >
                                                                    <FilterTemplate></FilterTemplate>
                                                                    <ItemTemplate>
                                                                        &nbsp;&nbsp;&nbsp;
                                                                            <asp:ImageButton ID="btnEdit" runat="server" CommandName="DataEdit" ImageUrl="~/App_UI/Images/Buttons/Edit.gif" ToolTip="แก้ไขรายการ" width="17"/>
                                                                            <%--<asp:LinkButton ID="btnEdit" runat="server" CommandName="DataEdit"
                                                                            CausesValidation="False" CssClass="linkbutton"> <img alt="แก้ไขข้อมูล" id="imgEdit" runat="server" src="~/App_UI/Images/Buttons/Edit.gif"  width="17"/></asp:LinkButton>            --%>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                                <telerik:GridBoundColumn DataField="receive_type_seq" 
                                                                    HeaderText="receive_type_seq" UniqueName="receive_type_seq" Visible="false" >
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="bgm_source_seq" 
                                                                    HeaderText="bgm_source_seq" UniqueName="bgm_source_seq" Visible="false">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="account_seq" 
                                                                    HeaderText="account_seq" UniqueName="account_seq" Visible="false">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="bgm_source_name" 
                                                                    HeaderText="แหล่งเงิน" UniqueName="bgm_source_name"
                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    HeaderStyle-Width="250px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="receive_type_name"
                                                                    HeaderText="กรณีรับเงิน"
                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-Width="303px" HeaderStyle-HorizontalAlign="Center">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="account_name"
                                                                    HeaderText="รหัสบัญชีรายได้"
                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                    HeaderStyle-Font-Bold="true"  HeaderStyle-HorizontalAlign="Center">
                                                                </telerik:GridBoundColumn><%--HeaderStyle-Width="300px"--%>
                                                            </Columns>
                                                            <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" /> 
                                                        </MasterTableView>
                                                        <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                          GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                          GroupSplitFormat="" />
                                                        <ClientSettings EnableRowHoverStyle="True">
                                                            <Selecting AllowRowSelect="true" />
                                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                        </ClientSettings>
                                             </telerik:RadGrid> 
                                                       <%-- <ClientSettings EnableRowHoverStyle="True">
                                                            <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                                                        </ClientSettings>
                                                    </telerik:RadGrid>--%>
                              </td>
                     </tr>
                     <tr>
                              <td>
                                             <fieldset style="width:900px; height: 120px" >
                                                   <legend> แก้ไขรายการ</legend>
                                                         <table align="center">
                                                                 <tr>
                                                                     <td align="left"><asp:Label runat="server" ID="lblBgmSourceName" Text="แหล่งเงิน :" Font-Bold="true"/></td>
                                                                     <td align="left"><telerik:RadTextBox ID="txtBgmSourceName" runat="server" title="แหล่งเงิน" Enabled="false" Width="350"></telerik:RadTextBox></td> 
                                                                 </tr>
                                                                 <tr>
                                                                     <td align="left"><asp:Label runat="server" ID="lblReceiveTypeName" Text="กรณีรับเงิน :" Font-Bold="true"/></td>
                                                                     <td align="left"><telerik:RadTextBox ID="txtReceiveTypeName" runat="server" title="กรณีรับเงิน" Enabled = "false" Width="350"></telerik:RadTextBox></td> 
                                                                 </tr>
                                                                 <tr>
                                                                      <td align="left"><asp:Label runat="server" ID="Label3" Text="รหัสบัญชีรายได้ :" Font-Bold="true"/></td>
                                                                      <td align="left">
                                                                          <%--<telerik:RadComboBox ID="cmbAccountCode" Runat="server"  
                                                                                    DataTextField="account_code_name" DataValueField="account_seq" 
                                                                                    Filter="Contains" Width="350" Enabled="false">
                                                                          </telerik:RadComboBox>--%>
                                                                            <telerik:RadComboBox ID="cmbAccountCode" Runat="server"
                                                                                        DataTextField="account_code_name" DataValueField="account_seq" 
                                                                                        EnableLoadOnDemand="true" 
                                                                                        ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                                                                        EmptyMessage="< เลือกรายการรหัสบัญชี >" AllowCustomText="true" Filter="Contains"
                                                                                        OnClientTextChange="OnTextChange"
                                                                                        OnItemsRequested="cmbAccountCode_ItemsRequested" Width="350px" title="รหัสบัญชีค่าใช้จ่ายระหว่างหน่วยงาน">
                                                                             </telerik:RadComboBox>
                                                                          <span class="span">&nbsp;*</span>
                                                                      </td>
                                                                      <td>
                                                                          <asp:ImageButton ID="btnAccountCode" runat="server" ImageUrl="~/App_UI/Images/Buttons/Search.png" Width="20px"
                                                                            OnClientClick="openWin()" />
                                                                          <telerik:RadTextBox ID="txtAccountCode" runat="server" title="รหัสบัญชีเงินได้" Width="350" Visible = "false"></telerik:RadTextBox>
                                                                          <asp:Label runat= "server" ID = "hbank_acc_seq" Visible ="false" />
                                                                          
                                                                      </td>      
                                                                 </tr>
                                                                 <tr>
                                                                     <td>
                                                                          <asp:Label runat="server" ID="hReceiveTypeSeq" visible = "false" />
                                                                          <asp:Label runat="server" ID="hAccountSeq" visible = "false" />
                                                                     </td>
                                                                 </tr>
                                                        </table>
                                             </fieldset>
                              </td>
                     </tr>     
                 </table>        
            </asp:Panel>
            
        <%--<script type="text/javascript">
           function openWin()
            {
                var oWnd = radopen("ACM_POPUP.aspx", "RadWindow1");
            }
//           function SetWindowBehavior(oWnd)
//            { 
//                configureUI(oWnd);
//            }
//            function configureUI(oWnd)
//            {
//                   var bounds = oWnd.getWindowBounds();
//                   var winHeight = bounds.height; 
//                   var winWidth = bounds.width; 
//                   
//                   //Configure height 
//                   winHeight = winHeight < 100 ? 100 : winHeight;
//                   winHeight = winHeight > 400 ? 400 : winHeight; 
//                   heightSlider.set_value(winHeight); 
//                   
//                   //Configure width 
//                   winWidth = winWidth < 100 ? 100 : winWidth;
//                   winWidth = winWidth > 700 ? 700 : winWidth; 
//                   widthSlider.set_value(winWidth); 
//                                  
//                   //Set the transparency slider to the current transparency level for the active RadWindow
//                   var initialTransp = oWnd.get_contentFrame().style.opacity; 
//                   if (null == initialTransp || '' == initialTransp) initialTransp = 1; 
//                   transpSlider.set_value(initialTransp * 100);
//                   
//                   //Make sure the window's corresponding tab is selected
//                    var windows = manager.get_windows(); 
//                    for (var i=0; i < windows.length; i++)
//                    { 
//                       if (windows[i] == oWnd)
//                       { 
//                         var tab = tabStrip.get_allTabs()[i]; 
//                         //Avoid recursion if tab already selected
//                         if (tab && !tab.get_selected())
//                         { 
//                            tab.select();
//                         }
//                       }
//                    } 
//              }
            function OnClientClose(oWnd,args)
               {
               //get the transferred arguments
               var arg = args.get_argument();
               if(arg)
                 { 

                   var accSeq = arg.account_seq;
                   $get("txtAccountCode").innerHTML = accSeq;
                 }
               }

        </script>--%>
     
     </div>
   </div>  
    
       <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" ReloadOnShow="true"
        runat="server" Skin="Vista">
        <Windows>
            <telerik:RadWindow runat="server" ID="RadWindow1"
                Width="639px" Height="622px"  Skin="Outlook" 
                VisibleStatusbar="true"
                OnClientClose="OnClientClose">
            </telerik:RadWindow> <%--OnClientResize="SetWindowBehavior"--%>
           
            <%--
            <telerik:RadWindow runat="server" ID="RadWindow2"
                Width="950px" Height="600px"
                OnClientClose="OnClientClose">
            </telerik:RadWindow>
            <telerik:RadWindow runat="server" ID="RadWindow3"
                Width="950px" Height="600px"
                OnClientClose="OnClientCloseExpRate">
            </telerik:RadWindow>--%>
            
            
        </Windows>
      </telerik:RadWindowManager>            
</asp:Content>            
